<?php $last_key = count($items) - 1 ?>
<?php $first_key = true; ?>

<?php echo '<ul>'; ?>

<?php foreach ($items as $key => $item): ?>
  <?php if ($key < $last_key): ?>
    <?php echo '<li ' . ($first_key ? ' class="home"' : '') . '>' . link_to(
      $item->getText(),
      $item->getUri(ESC_RAW),
      $item->getOptions() instanceOf sfOutputEscaperArrayDecorator ? $item->getOptions()->getRawValue() : $item->getOptions()
    ) . '</li>' ?>
  <?php else: ?>
    <?php echo '<li ' . ($first_key ? ' class="home"' : '') . ' ' . ($last_key > 0 ? ' class="last"' : '') . '><span>' . $item->getText() . '</span></li>' ?>
  <?php endif ?>
<?php $first_key = false; ?>
<?php endforeach ?>

<?php echo '</ul>'; ?>